home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH5 / 5-3-4.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-19  |  2.2 KB  |  76 lines

  1. VERSION 5.00
  2. Begin VB.Form frmQuiz 
  3.    Caption         =   "Quiz"
  4.    ClientHeight    =   2496
  5.    ClientLeft      =   2112
  6.    ClientTop       =   1740
  7.    ClientWidth     =   2568
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   7.8
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2496
  20.    ScaleWidth      =   2568
  21.    Begin VB.PictureBox picSolution 
  22.       Height          =   495
  23.       Left            =   120
  24.       ScaleHeight     =   444
  25.       ScaleWidth      =   2244
  26.       TabIndex        =   2
  27.       Top             =   1800
  28.       Width           =   2295
  29.    End
  30.    Begin VB.CommandButton cmdInterpret 
  31.       Caption         =   "Interpret Answer"
  32.       Height          =   495
  33.       Left            =   120
  34.       TabIndex        =   1
  35.       Top             =   1080
  36.       Width           =   2295
  37.    End
  38.    Begin VB.TextBox txtName 
  39.       Height          =   285
  40.       Left            =   120
  41.       TabIndex        =   0
  42.       Top             =   600
  43.       Width           =   2295
  44.    End
  45.    Begin VB.Label lblQuestion 
  46.       Alignment       =   2  'Center
  47.       Caption         =   "What was President Wilson's first name ?"
  48.       Height          =   495
  49.       Left            =   240
  50.       TabIndex        =   3
  51.       Top             =   120
  52.       Width           =   1935
  53.    End
  54. Attribute VB_Name = "frmQuiz"
  55. Attribute VB_GlobalNameSpace = False
  56. Attribute VB_Creatable = False
  57. Attribute VB_PredeclaredId = True
  58. Attribute VB_Exposed = False
  59. Private Sub cmdInterpret_Click()
  60.   Dim firstName As String
  61.   'Quiz
  62.   picSolution.Cls
  63.   firstName = txtName.Text
  64.   Select Case firstName
  65.     Case "Thomas"
  66.       picSolution.Print "Correct."
  67.     Case "Woodrow"
  68.       picSolution.Print "Sorry, his full name was"
  69.       picSolution.Print "Thomas Woodrow Wilson."
  70.     Case "President"
  71.       picSolution.Print "Are you for real?"
  72.     Case Else
  73.       picSolution.Print "Nice try, but no cigar."
  74.   End Select
  75. End Sub
  76.